﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace Shop_Inventory_Management
{
    class SynLog
    {
        private const string LOG_FILE = "SynLog.txt";

        public static void Log(string logString)
        {
            // Create a writer and open the file:
            StreamWriter SynLog;

            if (!File.Exists(LOG_FILE))
            {
                SynLog = new StreamWriter(LOG_FILE);
            }
            else
            {
                SynLog = File.AppendText(LOG_FILE);
            }

            // Write the error message to the file:
            SynLog.WriteLine(logString);

            // Close the stream:
            SynLog.Close();
        }

    }
}
